<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function say(text){
            return new Promise((res,rej)=>{
                setTimeout(() => {
                    res(text)
                }, 3000);
            })
        }
        async function asyncFn(){
            //await必须要在async函数里面
            //await后面的值必须是promise函数
            const bbb = await say('asdasd');
            let aaa = '1111'+ bbb;
            let ccc = '2222'
            console.log(aaa,ccc)
            return bbb;
        }
        asyncFn().then(res=>{
            console.log(res)//asdasd
        })
    </script>
</body>
</html>